import { MaterialContent } from './material-content.entity'
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm'

@Entity()
export class MaterialContentNewsItem {
  @PrimaryGeneratedColumn()
  id: number

  @Column()
  title: string

  @Column()
  author: string

  @Column()
  digest: string

  @Column()
  content: string

  @Column()
  content_source_url: string

  @Column()
  thumb_media_id: string

  @Column()
  show_cover_pic: boolean

  @Column({
    default: ''
  })
  url: string

  @Column()
  thumb_url: string

  @Column()
  need_open_comment: boolean

  @Column()
  only_fans_can_comment: boolean

  @ManyToOne(type => MaterialContent, content => content.news_item)
  @JoinColumn()
  materialContent: MaterialContent
}
